<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/12/11
 * Time: 16:38
 */
$id=$_REQUEST['id'];

$link=mysqli_connect('localhost','ni','123456')or die(json_encode(array('result'=>'connect database fail!')));

mysqli_select_db($link,'ajaxdb')or die(json_encode(array('result'=>'select database error')));

$sql_delete="delete from ys3181msg where id = '$id'";

mysqli_query($link,$sql_delete);

if (mysqli_affected_rows($link)>0){
    echo json_encode(array('result'=>'delete username success'));
}else{
    echo json_encode(array('result'=>'delete username fail!'));
}

mysqli_close($link);
